module.exports = function(window, document) {
	var apivm = require('../../common/avm.min')(window, document);
	var avm = apivm;
	var api = apivm.api;
	var Component = apivm.Component;
	var $ = apivm.$;
	(function() {
	var Myorderframe = /*@__PURE__*/ (function(Component) {
		function Myorderframe(props) {
			Component.call(this, props);
			this.data = {
				haveData: false
			};
		}

		if (Component) Myorderframe.__proto__ = Component;
		Myorderframe.prototype = Object.create(Component && Component.prototype);
		Myorderframe.prototype.constructor = Myorderframe;
		Myorderframe.prototype.render = function() {
			return apivm.h(
				"view",
				{class: "myorderframe-main"},
				this.data.haveData
					? apivm.h("scroll-view", {class: "myorderframe-list", "scroll-y": "true"})
					: apivm.h(
							"view",
							{class: "myorderframe-empty"},
							apivm.h("image", {
								class: "empty-img",
								src: "../../image/myorder_empty.png"
							})
					  )
			);
		};

		return Myorderframe;
	})(Component);
	apivm.define("myorderframe", Myorderframe);

	var StatusBarView = /*@__PURE__*/ (function(Component) {
		function StatusBarView(props) {
			Component.call(this, props);
			this.compute = {
				statusBarHeight: function() {
					if (api.safeArea) {
						return api.safeArea.top;
					} else {
						var res = wx.getSystemInfoSync();
						return res.statusBarHeight;
					}
				}
			};
		}

		if (Component) StatusBarView.__proto__ = Component;
		StatusBarView.prototype = Object.create(Component && Component.prototype);
		StatusBarView.prototype.constructor = StatusBarView;
		StatusBarView.prototype.render = function() {
			return apivm.h("view", {style: "height:" + this.statusBarHeight + "px;"});
		};

		return StatusBarView;
	})(Component);
	apivm.define("status-bar-view", StatusBarView);

	var Navigationbar = /*@__PURE__*/ (function(Component) {
		function Navigationbar(props) {
			Component.call(this, props);
		}

		if (Component) Navigationbar.__proto__ = Component;
		Navigationbar.prototype = Object.create(Component && Component.prototype);
		Navigationbar.prototype.constructor = Navigationbar;
		Navigationbar.prototype.onLeftButton = function(e) {
			api.closeWin();
		};
		Navigationbar.prototype.render = function() {
			return apivm.h(
				"view",
				{class: "nav-container"},
				apivm.h("status-bar-view", null),
				apivm.h(
					"view",
					{class: "nav-header"},
					apivm.h(
						"view",
						{
							class: "nav-header-button nav-left-button",
							onclick: this.props.onLeftButton
								? this.props.onLeftButton
								: this.onLeftButton
						},
						apivm.h("image", {
							width: this.props.leftButtonWidth ? this.props.leftButtonWidth : 11,
							src: this.props.leftButtonIcon
								? this.props.leftButtonIcon
								: "../../image/back.png",
							mode: "widthFix"
						}),
						apivm.h("text", {class: "nav-header-text"}, this.props.leftButtonText)
					),
					apivm.h("text", {class: "nav-header-title"}, this.props.title),
					apivm.h(
						"view",
						{
							class: "nav-header-button nav-right-button",
							onclick: this.props.onRightButton
						},
						apivm.h("image", {
							width: this.props.rightButtonWidth ? this.props.rightButtonWidth : 0,
							src: this.props.rightButtonIcon ? this.props.rightButtonIcon : "",
							mode: "widthFix"
						}),
						apivm.h("text", {class: "nav-header-text"}, this.props.rightButtonText)
					)
				)
			);
		};

		return Navigationbar;
	})(Component);
	apivm.define("navigationBar", Navigationbar);

	var Myorder = /*@__PURE__*/ (function(Component) {
		function Myorder(props) {
			Component.call(this, props);
			this.data = {
				menuList: [
					{
						title: "待付款",
						icon: "../../image/myorder_0.png",
						selectedIcon: "../../image/myorder_0_select.png"
					},
					{
						title: "待收货",
						icon: "../../image/myorder_1.png",
						selectedIcon: "../../image/myorder_1_select.png"
					},
					{
						title: "已完成",
						icon: "../../image/myorder_2.png",
						selectedIcon: "../../image/myorder_2_select.png"
					}
				],

				selectedIndex: 0
			};
		}

		if (Component) Myorder.__proto__ = Component;
		Myorder.prototype = Object.create(Component && Component.prototype);
		Myorder.prototype.constructor = Myorder;
		Myorder.prototype.fnSetFrameGroupIndex = function(e) {
			var index = e.currentTarget.dataset.index;
			if (this.data.selectedIndex == index) {
				return;
			}
			this.data.selectedIndex = index;
		};
		Myorder.prototype.onchange = function(e) {
			this.data.selectedIndex = e.detail.current;
		};
		Myorder.prototype.render = function() {
			var this$1 = this;
			return apivm.h(
				"view",
				{class: "main"},
				apivm.h("navigationBar", {title: "我的订单"}),
				apivm.h(
					"view",
					{class: "nav"},
					Object.entries(this.data.menuList).map(function(ref) {
						var index$1 = ref[0];
						var item$1 = ref[1];
						return apivm.h(
							"view",
							{class: "menu"},
							apivm.h(
								"view",
								{
									class:
										this$1.data.selectedIndex == index$1 ? "item item-selected" : "item",
									"data-index": index$1,
									onclick: this$1.fnSetFrameGroupIndex
								},
								apivm.h("image", {
									class: "radio",
									src:
										this$1.data.selectedIndex == index$1
											? item$1.selectedIcon
											: item$1.icon
								}),
								apivm.h(
									"text",
									{
										class:
											this$1.data.selectedIndex == index$1
												? "item-title item-title-selected"
												: "item-title"
									},
									item$1.title
								)
							)
						);
					})
				),
				apivm.h(
					"swiper",
					{
						class: "swiper",
						current: this.data.selectedIndex,
						onchange: this.onchange
					},
					apivm.h("swiper-item", null, apivm.h("myorderframe", null)),
					apivm.h("swiper-item", null, apivm.h("myorderframe", null)),
					apivm.h("swiper-item", null, apivm.h("myorderframe", null))
				)
			);
		};

		return Myorder;
	})(Component);
	apivm.define("myorder", Myorder);
	apivm.render(apivm.h("myorder", null), "body");
})();

	window['createApp'] = function() {
		apivm.$_start();
	}
	return avm;
}